<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<div class="page_left equipmentpage_left">
    <ul class="equipment_type">
        <li>
            <a class="equipment_typebtn ${!empty deviceType and empty deviceParamType?"cur":""}" href="javascript:;">设备类型</a>
            <ul class="equipment_typeMore" style="${!empty deviceType and empty deviceParamType?"display:block":""}">
                <c:forEach items="${typeList}" var="type">
                    <li><a href="javascript:;" name="${type.devicetypeid}" class="${type.devicetypeid eq deviceType and empty deviceParamType?"cur":""}">${type.dtname}</a></li>
                </c:forEach>
            </ul>
        </li>
    </ul>

    <ul class="equipment_parameter">
        <li>
            <a class="equipment_parameterbtn ${!empty deviceParamType?"cur":""}" href="javascript:;">类型参数</a>
            <ul class="equipment_parameterMore" style="${!empty deviceParamType?"display:block":""}">
                <c:forEach items="${typeList}" var="type">
                    <li>
                        <a class="equipment_parMorebtn ${type.devicetypeid eq deviceParamType and empty groupId?"cur2":""} ${type.devicetypeid eq deviceParamType and not empty groupId?"cur3":""} " href="javascript:;" name="${type.devicetypeid}">${type.dtname}</a>
                        <ul class="equipment_parMoreul"style="${type.devicetypeid eq deviceParamType?"display:block":""}">
                            <c:forEach items="${groupList}" var="groupType">
                                <li><a href="javascript:;" name="${groupType.paramgroupid}" class="${groupType.paramgroupid eq groupId?"cur":""}">${groupType.paramgroupname}</a></li>
                            </c:forEach>
                        </ul>
                    </li>
                </c:forEach>
            </ul>
        </li>
    </ul>
</div>
<script type="application/javascript">
    var uri = "${basePath}v2/factory/device/";
    $(".equipment_typeMore a").each(function(index){
        $(this).on("click", function() {
            var typeName = $(this).attr("name");
            window.location.href = uri+"showView/"+typeName;
        });
    });

    //设备列表左边点击事件  二级下拉
    function equipment_parameterSecond(){
        $(".equipment_parMorebtn").unbind("click");
        $(".equipment_parMorebtn").on("click", function(){
            var typeName = $(this).attr("name");
            window.location.href = uri+typeName+"/getParamGroup";
        });
    }
    equipment_parameterSecond();

    //设备列表左边点击事件  三级菜单
    function equipment_parameterThird(){
        $(".equipment_parMoreul a").on("click", function(){
            var typeName = '${deviceParamType}';
            var groupName = $(this).attr("name");
            window.location.href = uri+typeName+"/getParamGroup/"+groupName;
        });
    }
    equipment_parameterThird();

</script>